package com.bdd.Enum;

public enum SizeEnum {

    S(1, "S"),
    M(2, "M"),
    L(3, "L"),
    XL(4, "XL");


    private Integer id;
    private String name;

    SizeEnum(Integer i, String n) {
        id = i;
        name = n;

    }

    public static Integer getIdByName(String name) {
        for (SizeEnum size : SizeEnum.values()) {
            if (size.name().equalsIgnoreCase(name)) {
                return size.id;
            }
        }
        return -1;
    }

}
